<template>
  <div style="position: relative;  height: 100%">
    <!-- <div class="banner">
      <span>轻度污染</span>
      <span>晴</span>
      <span>24℃</span>
      <span>18</span>
      <span>西南</span>
    </div> -->
    <map-control @mapLoad="mapLoadEvent"/>
    <!-- <div class="left">
      <div class="top">
        <div class="title">
          <span>旅客流量</span>
          <el-select v-model="value" size="small" class="select">
            <el-option key="1" label="今日" value="1" />
            <el-option key="2" label="本周" value="2" />
            <el-option key="3" label="本月" value="3" />
          </el-select>
        </div>
        <div class="chart">报表占位</div>
      </div>
      <div class="center">
        <div class="title">
          <span>旅客流量</span>
          <el-select v-model="value" size="small" class="select">
            <el-option key="1" label="今日" value="1" />
            <el-option key="2" label="本周" value="2" />
            <el-option key="3" label="本月" value="3" />
          </el-select>
        </div>
        <div class="chart">报表占位</div>
      </div>
      <div class="bottom">
        <div class="title">
          <span>旅客流量</span>
          <el-select v-model="value" size="small" class="select">
            <el-option key="1" label="今日" value="1" />
            <el-option key="2" label="本周" value="2" />
            <el-option key="3" label="本月" value="3" />
          </el-select>
        </div>
        <div class="chart">报表占位</div>
      </div>
    </div>
    <div class="right">
      <div class="top">
        <div class="title">
          <span>旅客流量</span>
          <el-select v-model="value" size="small" class="select">
            <el-option key="1" label="今日" value="1" />
            <el-option key="2" label="本周" value="2" />
            <el-option key="3" label="本月" value="3" />
          </el-select>
        </div>
        <div class="chart">报表占位</div>
      </div>
      <div class="center">
        <div class="title">
          <span>旅客流量</span>
          <el-select v-model="value" size="small" class="select">
            <el-option key="1" label="今日" value="1" />
            <el-option key="2" label="本周" value="2" />
            <el-option key="3" label="本月" value="3" />
          </el-select>
        </div>
        <div class="chart">报表占位</div>
      </div>
      <div class="bottom">
        <div class="title">
          <span>旅客流量</span>
          <el-select v-model="value" size="small" class="select">
            <el-option key="1" label="今日" value="1" />
            <el-option key="2" label="本周" value="2" />
            <el-option key="3" label="本月" value="3" />
          </el-select>
        </div>
        <div class="chart">报表占位</div>
      </div>
    </div>
    <div class="box">
      <div class="layer">
        <div v-for="layer in layers">
          <span class="l">{{ layer.label }}</span>
          <el-switch class="s" v-model="layer.value" width="56" size="large" />
        </div>
        <img :src="image.layer" class="btn" width="36" height="36" />
      </div>
    </div>
    <div class="terminal">
      <span class="t" @click="test('T1')">T1</span>
      <span class="t" @click="test('T2')">T2</span>
      <span class="t" @click="test('T3')">T3</span>
      <span class="t" @click="test('T5')">T5</span>
      <img :src="image.terminal" class="btn" width="36" height="36" />
    </div>
  </div>
  <div class="btnGroup">
    <div v-for="btn in btns">
      <img :src="image[btn.path]" class="img" width="36" height="36" />
      <span>{{ btn.label }}</span>
    </div> -->
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { image } from '@/assets/index'
import mapControl from '@/components/map/index.vue'
import { store } from '@/components/map/mapStore'
import Header from '@/layout/Header/index.vue'

onMounted(() => {
  console.log(666)
})
// 定义获取menuid的变量
let num = ref("");
const mapLoadEvent = () => {
  console.log('1233213')
}
// 处理从子组件获得的变量
const setMenuId = (e) => {
  num.value = e
}
const value = ref('今日')
const layers = ref([
  { label: '摄像机', value: true},
  { label: '充电桩', value: true},
  { label: '饮水机', value: true},
  { label: '手推车', value: true},
  { label: '值机柜台', value: true},
  { label: '安检通道', value: true},
  { label: '登机口', value: true},
  { label: '行李转盘', value: true},
  { label: '中转柜台', value: true}
])
const btns = ref([
  { label: '报修维修', path: "repair"},
  { label: '施工协调', path: "construction"},
  { label: '航班动态', path: "flightDynamics"}
])


const test= (val: any) => {
  console.log(val)
};
</script>

<style lang="less" scoped>
* {
  font-family: "HarmonyOS Sans SC Medium";
}
.box {
  width: 180px;
  height: 360px;
  position: absolute;
  top: 475px;
  right: 476px;
  display: flex;
  align-items: flex-end;
}
.banner {
  width: 100%;
  height: 40px;
  text-align: center;
  font-size: 16px;
  background: linear-gradient(270deg, rgba(255,255,255,0%) 0%, #FFF 40%, #FFF 60%, rgba(255,255,255,0%) 100%);
}
.banner span {
  display: inline-block;
  line-height: 24px;
  color: #535862;
  margin-top: 8px;
  height: 24px;
  width: 120px;
}
.banner span:nth-child(3) {
  color: #2F7DF1
}
.banner span:not(:first-child) {
  border-left: 1px solid #848B9D;
}
.left {
  width: 440px;
  position: absolute;
  top: 24px;
  left: 24px;
}
.right {
  width: 440px;
  position: absolute;
  top: 24px;
  right: 24px;
}
.left div, .right div {
  padding: 16px 24px;
  border-radius: 8px;
  margin-bottom: 24px;
  background-color: #FFF;
}
.top {
  height: 278px;
}
.center {
  height: 198px;
}
.bottom {
  height: 238px;
}
.terminal {
  width: 21px;
  height: 36px;
  padding-left: 15px;
  position: absolute;
  top: 845px;
  right: 476px;
  background-color: #FFF;
  border-radius: 8px;
  transition: width 0.5s, transform 0.5s;
}
.terminal span {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  color: #FFF;
}
.terminal:hover {
  width: 180px;
}
.terminal:hover span {
  color: #353A42;
  position: unset;
  transition: width 0.5s, transform 0.5s;
  width: 36px;
  height: 36px;
  border: 0;
  margin-left: 1px;
  line-height: 36px;
  display: inline-block;
}
.btn {
  border-radius: 8px;
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 999;
  width: 36px;
  height: 36px;
  max-width: 100%;
  object-fit: none;
  background-color: #2F7DF1;
}
.layer {
  z-index: 99;
  text-align: center;
  padding: 0;
  width: 36px;
  height: 26px;
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #FFF;
  border-radius: 8px;
  transition: all 0s, transform 0.5s;
}
.layer div {
  margin-bottom: 4px;
}
.layer div .l {
  text-align: left;
  display: inline-block;
  width: 0;
  height: 0;
  line-height: 0;
  font-size: 0;
  color: #FFF;
}
.layer div .s {
  display: none;
}
.layer:hover {
  padding: 24px;
  width: 132px;
  height: 312px;
}
.layer:hover div .l {
  display: inline-block;
  width: 70px;
  height: 24px;
  line-height: 24px;
  font-size: 14px;
  color: #535862;
}
.layer:hover div .s {
  display: inline-block;
  height: 24px;
}
.title {
  padding: 0 !important;
  border-radius: 0 !important;
  width: 392px;
  height: 32px;
  color: #353A42;
  font-size: 16px;
  line-height: 32px;
  margin-bottom: 0 !important;
}
.title span {
  padding: 0;
  height: 32px;
  display: inline-block;
}
.title .select {
  margin-bottom: 0 !important;
  margin-top: 4px !important;
  float: right;
  padding: 0;
  width: 64px;
}
.chart {
  padding: 0 !important;
  height: 82%;
  background-color: #f90;
  border: 1px solid #337FCC;
  border-radius: 0 !important;
}
.btnGroup {
  position: absolute;
  left: 744px;
  top: 120px;
}
.btnGroup > div {
  margin-right: 36px;
  width: 120px;
  height: 36px;
  line-height: 36px;
  border-radius: 8px !important;
  background-color: #FFF;
  float: left;
}
.btnGroup img {
  max-width: 100%;
  object-fit: none;
  float: left;
  background-color: #2F7DF1;
  border-radius: 8px !important;
}
.btnGroup span {
  text-align: center;
  width: 80px;
  height: 36px;
  font-size: 14px;
  color: #353A42;
  line-height: 36px;
  display: inline-block;
}
</style>
